<?php namespace Common\Model;
use Hdphp\Model\Model;
/**
 * 商品模型
 */
class GoodsList extends Model {
	protected $tables='GoodsList';
	protected $validate=array(
		array('gltid','required','标题不能为空',3,3),
		array('glstock','required','必须选择分类',3,3),
		);
	public function store(){
		if(!$this->create()) return false;
		$gltid=implode(',',$_POST['gltid']); 
		$this->data['gltid']=$gltid;
		return $this->add();
	}
	public function edit($glid){
		if(!$this->create()) return false;
		$gltid=implode(',',$_POST['gltid']); 
		$this->where("glid={$glid}")->data['gltid']=$gltid;
		return $this->where("glid={$glid}")->save();
	}
}